package odch_handler;

use Log::Log4perl qw(:easy);
Log::Log4perl->easy_init($DEBUG);

use Dogtanian;
use odch;

sub data_arrival {
	DEBUG "entering data arrival";
	my ($user, $data) = @_;
	my $line = Dogtanian::parse_line($data);
	if ($line->{type} eq 'command') {
		Dogtanian::try {
			Dogtanian::dispatch($line);
		};
	} elsif ($line->{type} eq 'chat') {
		Dogtanian::try {
			Dogtanian::check($line);
		};
	}
}

sub hub_timer {
	DEBUG "hub timer!";
	#for (keys %Dogtanian::timed_events) {
	#	$Dogtanian::timed_events{$_}->();
	#}
}

1;
